]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnails: Move to primary monitor first when creating workspace
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 26 Apr 2014 14:17:24 +0000 (16:17 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 3 May 2014 21:50:25 +0000 (23:50 +0200)
When dragging a window preview from a non-primary monitor onto a
workspace thumbnail, the window is moved to the primery monitor
first before changing its workspace. However when dragging the window
between thumbnails to create a new workspace, it is kept on its current
monitor instead. This is not only inconsistent, but outright confusing
with the default 'workspaces-only-on-primary' setting, as the newly
created workspace is immediately removed again.

https://bugzilla.gnome.org/show_bug.cgi?id=683819

js/ui/workspaceThumbnail.js

index 1eb843dc9d46c27c9da87cc9d83003647b5e91d6..b1bc7cb49026c287ccad07f853234888c6053c7e 100644 (file)
@@ -826,10 +826,14 @@ const ThumbnailsBox = new Lang.Class({
                 window.change_workspace_by_index(window.get_workspace().index() + 1, true);
             });
 
-            if (isWindow)
+            if (isWindow) {
                 // ... and bam, a workspace, good as new.
+                // Move the window to our monitor first if necessary.
+                let thumbMonitor = this._thumbnails[newWorkspaceIndex].monitorIndex;
+                if (source.metaWindow.get_monitor() != thumbMonitor)
+                    source.metaWindow.move_to_monitor(thumbMonitor);
                 source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true);
-            else if (source.shellWorkspaceLaunch) {
+            } else if (source.shellWorkspaceLaunch) {
                 source.shellWorkspaceLaunch({ workspace: newWorkspaceIndex,
                                               timestamp: time });
                 // This new workspace will be automatically removed if the application fails